package com.example.Less.entity;



import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class ProjectQuery extends PageRequest {
    private String name;
    private String enName;
    private String addr;
    private String state;
    private Integer type;
    private String sort;
    private Integer isDeleted = 0;

    // 添加排序字段映射
    public String getOrderBy() {
        if (super.getOrderBy() == null) {
            return "createTime desc";
        }

        // 字段名映射
        String orderBy = super.getOrderBy();
        orderBy = orderBy.replace("create_time", "createTime");
        orderBy = orderBy.replace("project_name", "name");
        orderBy = orderBy.replace("project_addr", "addr");

        return orderBy;
    }
}